<template>
  <div class="app-container">
    <el-card>
      <div slot="header">
        <span>菜单管理</span>
      </div>
      <div class="filter-container">
        <el-button type="primary" @click="handleAdd">新增菜单</el-button>
      </div>
      <el-table :data="[]" row-key="id" :tree-props="{children: 'children'}" style="width: 100%">
        <el-table-column prop="name" label="菜单名称" />
        <el-table-column prop="icon" label="图标">
          <template slot-scope="{row}">
            <i :class="row.icon"></i>
          </template>
        </el-table-column>
        <el-table-column prop="sort" label="排序" width="80" />
        <el-table-column prop="perms" label="权限标识" />
        <el-table-column prop="path" label="路由地址" />
        <el-table-column prop="status" label="状态" width="80">
          <template slot-scope="{row}">
            <el-tag :type="row.status === '0' ? 'success' : 'danger'">
              {{ row.status === '0' ? '正常' : '停用' }}
            </el-tag>
          </template>
        </el-table-column>
        <el-table-column label="操作" width="200" align="center">
          <template slot-scope="{row}">
            <el-button size="mini" @click="handleEdit(row)">编辑</el-button>
            <el-button size="mini" type="danger" @click="handleDelete(row)">删除</el-button>
          </template>
        </el-table-column>
      </el-table>
    </el-card>
  </div>
</template>

<script>
export default {
  name: 'Menu',
  methods: {
    handleAdd() {
      // 处理添加菜单
    },
    handleEdit(row) {
      // 处理编辑菜单
    },
    handleDelete(row) {
      // 处理删除菜单
    }
  }
}
</script>

<style lang="scss" scoped>
.app-container {
  padding: 20px;
  
  .filter-container {
    padding-bottom: 20px;
  }
}
</style> 